package com.why.mapper;

import com.why.pojo.User;
import com.why.pojo.UserVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * @author new wei
 * @date 2022/5/19 22:08
 */
public interface UserMapper {

    List<User> list(UserVo vo);

    @Update("update t_user set username=#{username},password=#{password},telephone=#{telephone}," +
            "birthday=#{birthday},sex=#{sex} where id=#{id}")
    void update(User user);

    @Delete("delete from t_user where id=#{id}")
    int del(@Param("id") int id);

    @Select("select * from t_user where id=#{id}")
    User getUser(@Param("id") int id);
}
